package com.zrrd.io.conversionStream;

import java.io.*;

/**
 * @author WanJl
 * @version 1.0
 * @title InputStreamReaderDemo01
 * @description 输入转换流--从字节转换到字符
 * 读取文件中的字节，按照指定的字符集编码，转换字符
 * @create 2023/10/14 19:57
 */
public class InputStreamReaderDemo01 {
    public static void main(String[] args) throws Exception {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("D:/张三.txt"),"GBK");
        int length;
        while ((length=isr.read())!=-1){
            System.out.print((char)length);
        }
        isr.close();
    }
}
